package com.fengye.algorithms.huawei;

import java.util.Scanner;

/**
 * @Author fengye
 * @Date 2023/4/7 11:08
 **/
public class BigNumberAdd {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) {
            String aStr = in.next();
            String bStr = in.next();

            char[] aCh = aStr.toCharArray();
            char[] bCh = bStr.toCharArray();
            // 保证aCh长
            if (aStr.length() < bStr.length()) {
                aCh = bStr.toCharArray();
                bCh = aStr.toCharArray();
            }
            StringBuilder sb = new StringBuilder();
            int t = 0;
            for (int i = aCh.length - 1; i >= 0; i--) {
                int a = Integer.parseInt(Character.toString(aCh[i]));
                int b = 0;
                if (aCh.length - 1 - i < bCh.length) {
                    int bl = (bCh.length - 1) - (aCh.length - 1 - i);
                    b = Integer.parseInt(Character.toString(bCh[bl]));
                }

                int s = a + b + t;
                char[] sc = (s + "").toCharArray();
                if (sc.length == 1) {
                    sb.append(sc[0]);
                    t = 0;
                } else {
                    sb.append(sc[1]);
                    t = Integer.parseInt(Character.toString(sc[0]));
                }
            }

            if (t > 0) {
                sb.append(t);
            }

            String result = sb.reverse().toString();
            System.out.println(result);
        }
    }
}
